//
//  WWCategoryCollectionViewCellOfImageCell.m
//  YiQiTingShu
//
//  Created by WeiWei on 15/11/3.
//  Copyright © 2015年 直到世界的尽头. All rights reserved.
//

#import "WWCategoryCollectionViewCellOfImageCell.h"
#import <UIImageView+WebCache.h>

@interface WWCategoryCollectionViewCellOfImageCell ()

@property (nonatomic, strong) UILabel *wwLabel;
@property (nonatomic, strong) UIImageView *wwImageView;
@property (nonatomic, strong) UILabel *wwHeaderLabel;

@end

@implementation WWCategoryCollectionViewCellOfImageCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        _wwImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.wwImageView];
        _wwHeaderLabel = [[UILabel alloc] init];
        [self.contentView addSubview:_wwHeaderLabel];
        [self.wwHeaderLabel NightWithType:UIViewColorTypeNormal];
    }
    return self;
}

- (void)setModel:(WWModel *)model {
    _model = model;
    [_wwImageView sd_setImageWithURL:[NSURL URLWithString:model.coverPath] placeholderImage:[UIImage imageNamed:@"placeholderZh.png"]];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    _wwImageView.frame = self.contentView.frame;
}

@end
